﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="MyUser.aspx.cs" Inherits="MyUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <asp:Panel ID="AuthenticatedHeaderPanel" runat="server">
        <ul id="user">
            <li>
                <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Login.aspx" />
            </li>
        </ul>

        <div id="header-inner">
            <div class="textt">
            <h4>
                <asp:Label runat="server" ID="WelcomeBackMessage"></asp:Label>
                <asp:label id="lblMessage" runat="server" enableviewstate="false" />
            </h4>
            </div>
        </div>
    </asp:Panel>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Menu" Runat="Server">
<div id="left">
<div id = "navigation">
    <asp:Panel runat="server" ID="AuthenticatedMenuPanel" Width="200px">
        <div id="menu-header">
            <div class="menutext">
                <asp:Label ID="Label2" runat="server" Text="Menu"/>
            </div> 
        </div>
          <asp:Menu ID="Menu1" runat="server" StaticDisplayLevels="3" BackColor="White" DynamicHoverStyle-BorderStyle="NotSet" Width="200px">
              <Items>
                
                <asp:MenuItem Text="Home" Value="Home" navigateurl="Default.aspx">
                  <asp:MenuItem Text="New Document" Value="New Document" navigateurl="AddDocument.aspx">                   
                   </asp:MenuItem>
                </asp:MenuItem>

                <asp:MenuItem Text="Users" Value="My_Users" navigateurl="MyUsers.aspx">
                  <asp:MenuItem Text="New User" Value="New_User" navigateurl="AddUser.aspx">
                   </asp:MenuItem>
                </asp:MenuItem>
               
                <asp:MenuItem Text="Companies" Value="Companies" navigateurl="MyCompanies.aspx">
                  <asp:MenuItem Text="New Company" Value="New_Company" navigateurl="AddCompany.aspx">
                   </asp:MenuItem>
                </asp:MenuItem>
                
                <asp:MenuItem Text="Clients" Value="Clients" navigateurl="MyClients.aspx">
                  <asp:MenuItem Text="New Client" Value="New_Client" navigateurl="AddClient.aspx">
                   </asp:MenuItem>
                </asp:MenuItem>

              </Items>
          </asp:Menu>
     </asp:Panel>
</div>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
   <div id= "right"> 
    <asp:Panel runat="server" ID="AuthenticatedMessagePanel">
        <div class="box">
            <div class ="title">
                <h6>
                    <asp:Label ID="Label1" runat="server" Text="Edit user"></asp:Label>
                </h6>
            </div>
        <div class="lists">
            <table id="tab">
                <tbody>
                    <tr>
                        <th class="text">Name:<asp:Label ID="ID" runat="server" Enabled="False" Visible="false"></asp:Label></th>
                        <td>
                            <asp:TextBox ID="tb_name" runat="server" ValidationGroup="edit" Width="169px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="NameValidator" runat="server" ControlToValidate="tb_name" ErrorMessage="<div>Name cannot be blank.</div>" SetFocusOnError="true" Display="Dynamic" ValidationGroup="edit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Secondname:</th>
                        <td>
                            <asp:TextBox ID="tb_secondname" runat="server" ValidationGroup="edit" Width="169px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="SecondnameValidator" runat="server" ControlToValidate="tb_secondname" ErrorMessage="<div>Secondname cannot be blank.</div>" SetFocusOnError="true" Display="Dynamic" ValidationGroup="edit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Login:</th>
                        <td>
                            <asp:TextBox ID="tb_login" runat="server" ValidationGroup="edit" Width="169px" Text='<%# Eval("_login") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="LoginValidator" runat="server" ControlToValidate="tb_login" ErrorMessage="<div>Login cannot be blank.</div>" SetFocusOnError="true" Display="Dynamic" ValidationGroup="edit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Password:</th>
                        <td>
                            <asp:TextBox ID="tb_password" runat="server" ValidationGroup="edit" Width="169px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="PaswordValidator" runat="server" ControlToValidate="tb_password" ErrorMessage="<div>Please reenter password.</div>" SetFocusOnError="true" Display="Dynamic" ValidationGroup="edit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th class="text">E-mail:</th>
                        <td>
                            <asp:TextBox ID="tb_email" runat="server" ValidationGroup="edit" Width="169px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="EmailValidator" runat="server" ControlToValidate="tb_email" ErrorMessage="<div>Email cannot be blank.</div>" SetFocusOnError="true" Display="Dynamic" ValidationGroup="edit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Licence:</th>
                        <td>
                            <asp:DropDownList ID="DropLicence" runat="server"></asp:DropDownList>
                            <asp:RequiredFieldValidator ID="LicenceValidator" runat="server" ControlToValidate="DropLicence" ErrorMessage="<div>Licence cannot be blank.</div>" SetFocusOnError="true" Display="Dynamic" ValidationGroup="edit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Superuser:</th>
                        <td>
                            <asp:CheckBox ID="check_superuser" runat="server" Text=" " />
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Activated:</th>
                        <td>
                            <asp:CheckBox ID="check_activated" runat="server" Text=" " />
                        </td>
                    </tr>
                    <tr>
                        <th class="text">Additional user:</th>
                        <td>
                            <asp:CheckBox ID="check_additional_user" runat="server" Text=" " />
                        </td>
                    </tr>
                    <tr>
                        <th class="buttons">
                            <asp:Label ID="admin" runat="server" Text="false" Visible="False"/>
                        </th>
                        <td class="buttons">
                          <div class="button">
                            <ul id="confirm">
                              <li>
                                <asp:LinkButton ID="CancelButton" CommandName="Cancel" runat="server" Text="Cancel" CausesValidation="false" onclick="CancelButton_Click" Width="60px"></asp:LinkButton>
                              </li>
                              <li>
                                <asp:LinkButton ID="UpdateButton" CommandName="Save" runat="server" Text="Update" ValidationGroup="edit" onclick="UpdateButton_Click" Width="60px"></asp:LinkButton>
                              </li>
                            </ul>
                          </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
      </div>
    </asp:Panel>
</div>
</asp:Content>